home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib9 / v_11_09 / 1109105a < prev    next >
Encoding:
Text File  |  1995-11-01  |  346 b   |  25 lines

  1. #include <iostream.h>
  2.  
  3. class File
  4.     {
  5. public:
  6.     File() { ok = FALSE; }
  7.     bool good() { return ok; }
  8.     void reset(bool b = TRUE) { ok = bool(b); }
  9. private:
  10.     enum bool {FALSE, TRUE};
  11.     bool ok;
  12.     };
  13.  
  14. int main()
  15.     {
  16.     File f;
  17.     cout << f.good() << '\n';
  18.     cout << sizeof(f.good()) << '\n';
  19.     cout << sizeof(f) << '\n';
  20.     return 0;
  21.     }
  22.  
  23.  
  24.  
  25.